package com.spingweb.dto;

import java.util.Date;

/**
 * 这是一个简单的商品类
 * 当然实际工程中，针对不同的产品应该有不同的实体类，这里简化为统一的格式。
 * 比如食品通常有保质期，而图书则没有。
 */
public class Product {
    private Long id;
    //很显然，商品的名字应该具有唯一性，但是在处理商品时，这却不是好的的字段，用数字则更有通用性。
    private String bame;
    private String place;
    private Integer num;
    private String unit;
    private Float price;
    private Float discount;
    private Date producedDate;
    private Date expiredDate;

    public Product() {
    }

    /**
     * 一个存构造器，一个取构造器，想想空构造器干啥的
     *
     * @param id           商品id
     * @param bame         名称
     * @param place        产地
     * @param num          库存量
     * @param unit         销售单位
     * @param price        价格
     * @param producedDate 生产时间。
     * @param expiredDate  过期时间
     */
    public Product(Long id, String bame, String place, Integer num, String unit, Float price, Float discount, Date producedDate, Date expiredDate) {
        this.id = id;
        this.bame = bame;
        this.place = place;
        this.num = num;
        this.unit = unit;
        this.price = price;
        this.discount = discount;
        this.producedDate = producedDate;
        this.expiredDate = expiredDate;
    }

    public Product(String bame, String place, Integer num, String unit, Float price, Float discount, Date producedDate, Date expiredDate) {
        this.bame = bame;
        this.place = place;
        this.num = num;
        this.unit = unit;
        this.price = price;
        this.discount = discount;
        this.producedDate = producedDate;
        this.expiredDate = expiredDate;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getBame() {
        return bame;
    }

    public void setBame(String bame) {
        this.bame = bame;
    }

    public String getPlace() {
        return place;
    }

    public void setPlace(String place) {
        this.place = place;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public Float getPrice() {
        return price;
    }

    public void setPrice(Float price) {
        this.price = price;
    }

    public Date getProducedDate() {
        return producedDate;
    }

    public void setProducedDate(Date producedDate) {
        this.producedDate = producedDate;
    }

    public Float getDiscount() {
        return discount;
    }

    public void setDiscount(Float discount) {
        this.discount = discount;
    }

    public Date getExpiredDate() {
        return expiredDate;
    }

    public void setExpiredDate(Date expiredDate) {
        this.expiredDate = expiredDate;
    }
}
